import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);
const VueRouterPush = Router.prototype.push
Router.prototype.push = function push (to) {
    return VueRouterPush.call(this, to).catch(err => err)
}
export default new Router({
    routes: [
        {
            path: '/',
            component: () => import('../components/common/Home'),
            meta: { title: '自述文件' },
            children: [
                {
                    path:'/house',
                    component:()=>import('../components/page/house'),
                    meta: {title:'房屋一览'}
                },
                {
                    path: '/404',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },

        // {
        //     path: '*',
        //     redirect: '/404'
        // }
    ]
});
